package com.woniu.HisHospitalizationApiImpl;

import com.woniu.HisHospitalizationApi.HisRoomApi;
import com.woniu.dto.HisRoomDto;
import com.woniu.dto.PageDTO;
import com.woniu.exception.DIYException;
import com.woniu.mapper.HisRoomMapper;
import com.woniu.model.HisRoom;
import com.woniu.param.HisRoomAddParam;
import com.woniu.param.HisRoomParam;
import com.woniu.param.PageParam;
import com.woniu.service.IHisRoomService;
import com.woniu.util.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

@RestController
@Slf4j
public class HisRoomApiImpl implements HisRoomApi {
    @Resource
    private HisRoomMapper hisRoomMapper;
    @Resource
    private IHisRoomService hisRoomService;


    @Override
    public Result<HisRoomDto> addHisRoom(HisRoomAddParam hisRoomAddParam) {
        return hisRoomService.addHisRoom(hisRoomAddParam);
    }

    @Override
    public Result<Boolean> deleteHisRoomById(ArrayList<Integer> id) {
        return hisRoomService.deleteHisRoomById(id);
    }

    @Override
    public Result<HisRoomDto> updateHisRoom(HisRoomParam hisRoomParam) {
        return hisRoomService.updateHisRoom(hisRoomParam);
    }

    @Override
    public Result<PageDTO<HisRoomDto>> getHisRoomById(HisRoomParam hisRoomParam) {
        return hisRoomService.getHisRoomById(hisRoomParam);
    }

    @Override
    public Result<PageDTO<HisRoomDto>> getAllRoom(PageParam pageParam) {
        return hisRoomService.getAllRoom(pageParam);
    }
}
